﻿using System;
using System.Collections.Generic;
using System.Web.UI;

using Developmentalmadness.Web.UI.AjaxAbstractions;

namespace Developmentalmadness.Web.UI.ExtJsControlLibrary
{
    public class ExtJsSplitButton : ExtJsButton
    {
        public override IList<ScriptDescriptor> GetScriptDescriptors()
        {
            IList<ScriptDescriptor> list = base.GetScriptDescriptors();

            ScriptControlDescriptorBase desc = (ScriptControlDescriptorBase)list[0];

            desc.Type = "Ext.SplitButton";

            if (!String.IsNullOrEmpty("arrowHandler"))
                desc.AddPropertyBase("arrowHandler", String.Format("'{0}'", arrowHandler));

            if (!String.IsNullOrEmpty("arrowTooltip"))
                desc.AddPropertyBase("arrowTooltip", String.Format("'{0}'", arrowTooltip));

            return list;
        }

        #region PublicProperties

        public String arrowHandler { get; set; }

        public String arrowTooltip { get; set; }

        #endregion
    }
}
